package com.netty.services.impl;

import com.netty.mappers.MsgMapper;
import com.netty.model.entity.Msg;
import com.netty.services.MsgService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class MsgServiceImpl implements MsgService {

    @Autowired
    private MsgMapper msgMapper;

    @Override
    public int addMsg(Msg msg) {
        return msgMapper.addMsg(msg);
    }

    @Override
    public List<Msg> getAllMsg(Integer receiverUserId) {
        return msgMapper.getAllMsg(receiverUserId);
    }

    @Override
    public int updateMsgToSignStatus(List<Integer> msgIdList) {
        return msgMapper.updateMsgToSignStatus(msgIdList);
    }

    @Override
    public List<Msg> getUnReadMsgList(Integer acceptUserId) {
        return msgMapper.getUnReadMsgList(acceptUserId);
    }
}
